Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@nextgis/properties-filter
Advanced tools
An auxiliary library that allows filtering objects by its properties using JSON-serializable expressions
# latest stable
$ npm install --save-dev @nextgis/properties-filter
# or
$ yarn add @nextgis/properties-filter
General view of expression
[ С , [E1] , [E2] , [EN] ]
С - condition (optional). May be 'all' or 'any';
E - expression:
[key, operator, value]
gt
, lt
, ge
, le
, eq
, ne
, in
, notin
, like
, ilike
;in
and notin
:
like
and ilike
:
Place %
-character after or before key
string to determine the direction of search.
Nesting
[ [E1], ['any', [E2], [E3, E4] ], ['any', [E5], [E6] ] ] ]
Example
import { propertiesFilter, featureFilter } from '@nextgis/properties-filter';
const properties = {
place: 'Tofalaria',
area: 21,
};
propertiesFilter(properties, [['place', 'eq', 'Tofalaria']]); // true
propertiesFilter(properties, [['place', 'in', ['Tofalaria', 'Siberia']]]); // true
propertiesFilter(properties, [['place%', 'like', 'Tof']]); // true
propertiesFilter(properties, [
// 'and', // - by default
['place', 'eq', 'Tofalaria'],
['area', 'ge', 21],
]); // true
propertiesFilter(properties, [
'any',
['place', 'eq', 'Siberia'],
['area', 'gt', 10],
]); // true
Need to fix a bug or add a feature to @nextgis/properties-filter
? We provide custom development and support for this software. Contact us to discuss options!
FAQs
Filtering objects by its properties using expressions
The npm package @nextgis/properties-filter receives a total of 73 weekly downloads. As such, @nextgis/properties-filter popularity was classified as not popular.
We found that @nextgis/properties-filter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.